package label

import (
	"github.com/gin-gonic/gin"
	"robotDaBai/app/common/dao"
)

var (
	UserDefault * UserLabel
	userInit = false	//初始化
)

//获取用户昵称
func (l *UserLabel) GetUserName() string {
	defaultUserInit()
	return l.NickName
}


//初始化用户信息
func defaultUserInit(){
	if userInit==false{
		UserDefault = newUserInit(8)
	}
}

//初始化生成用户信息
func newUserInit(Id int8) *UserLabel{
	UserInfo,err:=(&dao.User{}).GetIdInfo(&gin.Context{},1)
	if err!=nil{

	}
	user:=&UserLabel{}
	user.NickName = UserInfo.NickName
	user.Id = UserInfo.Id
	user.Money = UserInfo.Money
	userInit = true
	return user
}